-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let the quota evaluator handle mutating specs of pod & pvc #51174
Let the quota evaluator handle mutating specs of pod & pvc #51174
Conversation
/release-note-none |
// fail closed, will try to give an evaluation. | ||
return true | ||
} | ||
// only uninitilized pvc might be updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: uninitilized
@@ -147,6 +148,84 @@ var _ = framework.KubeDescribe("ResourceQuota", func() { | |||
Expect(err).NotTo(HaveOccurred()) | |||
}) | |||
|
|||
It("should create a ResourceQuota and capture the life of an uninitialized pod.", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I leave the test here to show what the end goal is. I can move the test to #50344 if that's better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine if 50344 uncomments it.
6e6bacd
to
4928c8d
Compare
@liggitt @derekwaynecarr @smarterclayton PTAL. Thanks. |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: caesarxuchao, smarterclayton Associated issue: 47837 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would like your recommendation on how i can map your changes with the desire to do #51370
// TODO: update this if/when pods support resizing resource requirements. | ||
return admission.Create == operation | ||
// Handles returns true of the evaluator should handle the specified attributes. | ||
func (p *podEvaluator) Handles(a admission.Attributes) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have a goal to enable the following:
#51370
where do you recommend i best layer in the referenced goal with the need to support initializers?
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
Background
The final goal is to address #47837, which aims to allow more mutation for uninitialized objects.
To do that, we decided to let the admission controllers to handle mutation of uninitialized objects.
Issue
#50399 attempted to fix all admission controllers so that can handle mutating uninitialized objects. It was incomplete. I didn't realize although the resourcequota admission plugin handles the update operation, the underlying evaluator didn't. This PR updated the evaluators to handle updates of uninitialized pods/pvc.
TODO
We still miss another piece. The quota replenish controller uses the sharedinformer, which doesn't observe the deletion of uninitialized pods at the moment. So there is a quota leak if a pod is deleted before it's initialized. It will be addressed with #48893.